package org.kfish.framework.bean;

import java.util.HashMap;
import java.util.Map;

import com.google.gson.Gson;

public class View {

	private Map<String,Object> model;
	private String path;
	
	public View(String path){
		this.path = path;
		this.model = new HashMap<>();
	}
	
	public View addModel(String key,Object value){
		model.put(key, value);
		return this;
	}
	
	public String getPath(){
		return path;
	}
	
	public Map<String,Object> getModel(){
		return model;
	}
	
	@Override
	public String toString() {
		 Gson gson = new Gson();
		return gson.toJson(this);
	}
}
